package com.alibaba.cloud.utils;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;


/**
 * The Class RandomUtils.
 *
 * @ClassName: RandomUtils
 * @Description: 随机数生成工具类
 * @author: zhb zhb1316783262@163.com
 * @date: 2017年10月30日 上午9:52:17
 */
public class RandomUtils {

    /**
     * Random number.
     *
     * @return the string
     */
    public static String randomNumber() {
        String str = "0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < 6; i++) {
            int number = random.nextInt(10);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }

    /**
     * Random number.
     *
     * @return the string
     */
    public static Long random() {
        return ThreadLocalRandom.current().nextLong();
    }
}
